﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mes.Application.DTO.Inputs.WorkOrders
{
    public class AddingItemProdInput
    {
        /// <summary>
        /// 工单编号
        /// </summary>
        public string Wo_Id { get; set; } = string.Empty;

        /// <summary>
        /// 操作编号
        /// </summary>
        public string Oper_Id { get; set; } = string.Empty;

        /// <summary>
        /// 当前实体ID
        /// </summary>
        public int Ent_Id { get; set; }

        /// <summary>
        /// 产量
        /// </summary>
        public double Qty_Prod { get; set; }

        /// <summary>
        /// 物料ID
        /// </summary>
        public int Item_Id { get; set; }

        /// <summary>
        /// 目标存储位置
        /// </summary>
        public int? To_Ent_Id { get; set; }

        /// <summary>
        /// 是否是良品
        /// </summary>
        public bool Good_Prod { get; set; }
    }

    public class ReducingItemProdInput
    {
        /// <summary>
        /// 工单编号
        /// </summary>
        public string Wo_Id { get; set; } = string.Empty;

        /// <summary>
        /// 操作编号
        /// </summary>
        public string Oper_Id { get; set; } = string.Empty;

        /// <summary>
        /// 当前实体ID
        /// </summary>
        public int Ent_Id { get; set; }

        /// <summary>
        /// 减少的产量（必须小于现有的良品的产量）
        /// </summary>
        public double Qty_Prod { get; set; }

        /// <summary>
        /// 物料ID
        /// </summary>
        public int? Item_Id { get; set; }

        /// <summary>
        /// 目标存储位置
        /// </summary>
        public int? To_Ent_Id { get; set; }

        /// <summary>
        /// 是否是良品
        /// </summary>
        public bool Good_Prod { get; set; }
    }
    public class GettingEntJobsInput
    {
        /// <summary>
        /// 实体ID
        /// </summary>
        public int Ent_Id { get; set; }
    }

    public class GettingRunningJobProdsBOMsStepsInput
    {
        /// <summary>
        /// 工单编号
        /// </summary>
        public string Wo_Id { get; set; } = string.Empty;

        /// <summary>
        /// 操作编号
        /// </summary>
        public string Oper_Id { get; set; } = string.Empty;
    }

    public class AddingItemConsInput
    {
        /// <summary>
        /// 工单编号
        /// </summary>
        public string Wo_Id { get; set; } = string.Empty;

        /// <summary>
        /// 操作编号
        /// </summary>
        public string Oper_Id { get; set; } = string.Empty;

        /// <summary>
        /// 当前实体ID
        /// </summary>
        public int Ent_Id { get; set; }

        /// <summary>
        /// 物料ID
        /// </summary>
        public int Item_Id { get; set; }

        /// <summary>
        /// 消耗量
        /// </summary>
        public double Qty_Cons { get; set; }

        /// <summary>
        /// 目标存储位置ID
        /// </summary>
        public int? From_Ent_Id { get; set; }
    }

    public class StartingJobStepInput
    {
        /// <summary>
        /// 工单编号
        /// </summary>
        public string Wo_Id { get; set; } = string.Empty;

        /// <summary>
        /// 操作编号
        /// </summary>
        public string Oper_Id { get; set; } = string.Empty;

        /// <summary>
        /// 当前实体ID
        /// </summary>
        public int Ent_Id { get; set; }

        /// <summary>
        /// 工步组ID
        /// </summary>
        public int Step_Grp_Id { get; set; }

        /// <summary>
        /// 工步编号
        /// </summary>
        public int Step_No { get; set; }
    }

    public class StoppingJobStepInput
    {
        /// <summary>
        /// 工单编号
        /// </summary>
        public string Wo_Id { get; set; } = string.Empty;

        /// <summary>
        /// 操作编号
        /// </summary>
        public string Oper_Id { get; set; } = string.Empty;

        /// <summary>
        /// 当前实体ID
        /// </summary>
        public int Ent_Id { get; set; }

        /// <summary>
        /// 工步组ID
        /// </summary>
        public int Step_Grp_Id { get; set; }

        /// <summary>
        /// 工步编号
        /// </summary>
        public int Step_No { get; set; }

        /// <summary>
        /// 状态编号 4-COMPLETE 9-SUPERSEDED
        /// </summary>
        public int State_Cd { get; set; }
    }

    public class ReadyingJobInput
    {
        /// <summary>
        /// 工单编号
        /// </summary>
        public string Wo_Id { get; set; } = string.Empty;

        /// <summary>
        /// 操作编号
        /// </summary>
        public string Oper_Id { get; set; } = string.Empty;
    }

    public class RunningJobInput
    {
        /// <summary>
        /// 工单编号
        /// </summary>
        public string Wo_Id { get; set; } = string.Empty;

        /// <summary>
        /// 操作编号
        /// </summary>
        public string Oper_Id { get; set; } = string.Empty;

        /// <summary>
        /// 实体ID
        /// </summary>
        public int Ent_Id { get; set; }
    }

    public class PausingJobInput
    {
        /// <summary>
        /// 工单编号
        /// </summary>
        public string Wo_Id { get; set; } = string.Empty;

        /// <summary>
        /// 操作编号
        /// </summary>
        public string Oper_Id { get; set; } = string.Empty;

        /// <summary>
        /// 实体ID
        /// </summary>
        public int Ent_Id { get; set; }

        /// <summary>
        /// 暂停状态
        /// </summary>
        public int Paused_Job_State { get; set; }
    }

    public class EndingJobInput 
    {
        /// <summary>
        /// 工单编号
        /// </summary>
        public string Wo_Id { get; set; } = string.Empty;

        /// <summary>
        /// 操作编号
        /// </summary>
        public string Oper_Id { get; set; } = string.Empty;

        /// <summary>
        /// 实体ID
        /// </summary>
        public int Ent_Id { get; set; }
    }
}
